<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>test_servers (ServerMonitor::Monitor)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File ServerMonitor.rb, line 160</span>
                <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_servers</span>
                        <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Empty Server List&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@servers</span>.<span class="ruby-identifier">empty?</span>
                        <span class="ruby-identifier">ts</span> = <span class="ruby-constant">TestSuite</span>.<span class="ruby-identifier">new</span>
                        <span class="ruby-ivar">@servers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">server</span><span class="ruby-operator">|</span>
                                <span class="ruby-identifier">server</span>.<span class="ruby-identifier">ports</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">port</span><span class="ruby-operator">|</span>
                                        <span class="ruby-identifier">port</span>.<span class="ruby-identifier">tested</span> = <span class="ruby-keyword kw">true</span>
                                        (<span class="ruby-identifier">port</span>.<span class="ruby-identifier">success</span>, <span class="ruby-identifier">port</span>.<span class="ruby-identifier">time</span>) = <span class="ruby-identifier">ts</span>.<span class="ruby-identifier">test_port</span>(<span class="ruby-identifier">server</span>.<span class="ruby-identifier">domain</span>,<span class="ruby-identifier">port</span>.<span class="ruby-identifier">number</span>)
                                <span class="ruby-keyword kw">end</span>
                                <span class="ruby-identifier">server</span>.<span class="ruby-identifier">urls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">url</span><span class="ruby-operator">|</span>
                                        <span class="ruby-identifier">url</span>.<span class="ruby-identifier">tested</span> = <span class="ruby-keyword kw">true</span>
                                        (<span class="ruby-identifier">url</span>.<span class="ruby-identifier">success</span>, <span class="ruby-identifier">url</span>.<span class="ruby-identifier">time</span>) = <span class="ruby-identifier">ts</span>.<span class="ruby-identifier">test_url</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">url</span>)
                                <span class="ruby-keyword kw">end</span>
                        <span class="ruby-keyword kw">end</span>
                        <span class="ruby-ivar">@report</span>.<span class="ruby-identifier">text</span> = <span class="ruby-identifier">ts</span>.<span class="ruby-identifier">log</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
                        <span class="ruby-ivar">@report</span>.<span class="ruby-identifier">delimited</span> = <span class="ruby-identifier">generate_delimited_report</span>(<span class="ruby-ivar">@servers</span>)
                        <span class="ruby-ivar">@report</span>.<span class="ruby-identifier">xml</span> = <span class="ruby-identifier">generate_xml_report</span>(<span class="ruby-ivar">@servers</span>)
                <span class="ruby-keyword kw">end</span></pre>
</body>
</html>